在Android中,ClassLoader是一个抽象类,定义为:public abstract class ClassLoader 在实际开发中,一般使用其子类DexClassLoader和PathClassLoader来创建类加载器实例,进而加载类,需要说明的是,这两个类都继承于BaseDexClassLoader,BaseDexClassLoader又继承于ClassLoader,他们之间的关系如下,图片来自gityuan
/** * Makes an array of dex/resource path elements, one per element of the given array. */ privatestatic Element[] makePathElements(List<File> files, File optimizedDirectory,List<IOException> suppressedExceptions) { List<Element> elements = new ArrayList<>(); /* * Open all files and load the (direct or contained) dex files up front. */ for (File file : files) { File zip = null; File dir = new File(""); DexFile dex = null; String path = file.getPath(); String name = file.getName(); ...... ...... elseif (file.isFile()) { if (name.endsWith(DEX_SUFFIX)) { // Raw dex file (not inside a zip/jar). dex = loadDexFile(file, optimizedDirectory); } }//endif if (file.isFile()) if ((zip != null) || (dex != null)) { elements.add(new Element(dir, false, zip, dex)); } }//endfor for (File file : files) return elements.toArray(new Element[elements.size()]); }
/** * Constructs a {@code DexFile} instance, as appropriate depending * on whether {@code optimizedDirectory} is {@code null}. */ privatestatic DexFile loadDexFile(File file, File optimizedDirectory) throws IOException { if (optimizedDirectory == null) { returnnew DexFile(file); } else { String optimizedPath = optimizedPathFor(file, optimizedDirectory); return DexFile.loadDex(file.getPath(), optimizedPath, 0); } }
/** * Converts a dex/jar file path and an output directory to an * output file path for an associated optimized dex file. */ privatestatic String optimizedPathFor(File path, File optimizedDirectory){ /* * Get the filename component of the path, and replace the * suffix with ".dex" if that's not already the suffix. */ String fileName = path.getName(); if (!fileName.endsWith(DEX_SUFFIX)) { int lastDot = fileName.lastIndexOf("."); if (lastDot < 0) { fileName += DEX_SUFFIX; } else { StringBuilder sb = new StringBuilder(lastDot + 4); sb.append(fileName, 0, lastDot); sb.append(DEX_SUFFIX); fileName = sb.toString(); } } File result = new File(optimizedDirectory, fileName); return result.getPath(); }
@Deprecated protectedfinal Class<?> defineClass(byte[] classRep, int offset, int length) throws ClassFormatError { thrownew UnsupportedOperationException("can't load this type of class file"); }
/** * Loads the class with the specified name. Invoking this method is * equivalent to calling {@code loadClass(className, false)}. */ public Class<?> loadClass(String className) throws ClassNotFoundException { return loadClass(className, false); }
/** * Loads the class with the specified name, optionally linking it after * loading. */ protected Class<?> loadClass(String className, boolean resolve) throws ClassNotFoundException { Class<?> clazz = findLoadedClass(className); if (clazz == null) { ClassNotFoundException suppressed = null; try { clazz = parent.loadClass(className, false); } catch (ClassNotFoundException e) { suppressed = e; } if (clazz == null) { try { clazz = findClass(className); } catch (ClassNotFoundException e) { e.addSuppressed(suppressed); throw e; } } } return clazz; }
/** * Finds the named class in one of the dex files pointed at by * this instance. This will find the one in the earliest listed * path element. If the class is found but has not yet been * defined, then this method will define it in the defining * context that this instance was constructed with. */ public Class findClass(String name, List<Throwable> suppressed){ for (Element element : dexElements) { DexFile dex = element.dexFile; if (dex != null) { Class clazz = dex.loadClassBinaryName(name, definingContext, suppressed); if (clazz != null) { return clazz; } } } if (dexElementsSuppressedExceptions != null) { suppressed.addAll(Arrays.asList(dexElementsSuppressedExceptions)); } returnnull; }
unlinkfastbin attackHouse of spiritHouse of ForceUAFDynELFPIEformat stringoff by onex6464bit格式化字符串漏洞栈溢出Canarytcachelibc-2.29chunk overlappingchunk extendshellcode,系统调用libc2.29stack overflowfmtrop2016,CTFs,fsbCTFstack pivotingOSpwnablefsb
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是archer根目录)执行以下命令: npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置: